#include <REGX52.H>
#include <INTRINS.H>

void Delay1ms(unsigned int delay)		//@11.0592MHz
{
	unsigned char i, j;
	while(delay){
		_nop_();
		i = 2;
		j = 199;
		do
		{
			while (--j);
		} while (--i);
		delay--;
	}
}

void main(){
	unsigned int delay = 50;//delay xxx ms
	while(1){
		P2 = 0xfe;//1111 1110
		Delay1ms(delay);
		P2 = 0xfd;//1111 1101
		Delay1ms(delay);
		P2 = 0xfb;//1111 1011
		Delay1ms(delay);
		P2 = 0xf7;//1111 0111
		Delay1ms(delay);
		P2 = 0xef;//1110 1111
		Delay1ms(delay);
		P2 = 0xdf;//1011 1111
		Delay1ms(delay);
		P2 = 0xbf;//0111 1111
		Delay1ms(delay);
		P2 = 0x7f;//0111 1111
		Delay1ms(delay);
	}

}